<%-- 
    Document   : FillAttendance
    Created on : May 15, 2014, 4:01:57 PM
    Author     : Mukesh
--%>


<%@page import="java.util.Date"%>
<%@page import="java.util.GregorianCalendar"%>
<%@page import="java.util.Calendar"%>
<%
    try {
        if (session.getAttribute("uid") != null) {
            if (session.getAttribute("Fees_Deposit").toString().equals("1")) {
%>
<%String to = "", status = "", msg = "";%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <title>Ramgovind Automated System</title>
        <link rel="stylesheet" href="/RIT/css/bootstrap.css">
        <link rel="stylesheet" href="/RIT/css/bootstrap-responsive.css">
        <link rel="stylesheet" href="/RIT/css/jquery.fancybox.css">
        <link rel="stylesheet" href="/RIT/css/style.css">
        <link rel="stylesheet" href="/RIT/css/iconfont.css">
        <link rel="stylesheet" href="/RIT/css/bootstrap.datepicker.css">
        <script src="../../ajax/ajax.js"></script>
        <style>
            td{
                width: 25px;
                padding-bottom: 4px;
            }
            .headings{
                width: 100px;
                height: 20px;
            }
        </style>
    </head>
    <body>
        <div id="ILoader"></div>
        <%@include file="/topheader.html" %>
        <%@include file="/servicesheader.html" %>
        <div class="main">
            <div class="container-fluid">
                <%@include file="/Services/Accounts/accsidenav.jsp" %>
                <div class="content">
                    <%if (session.getAttribute("status") != null) {
                            status = session.getAttribute("status").toString();
                            msg = session.getAttribute("msg").toString();
                    %>
                    <div class="alert alert-success alert-block">
                        <a class="close" data-dismiss="alert" href="#"><img src="/RIT/img/mclose.png"></a>
                        <h4 class="alert-heading"> <%=status%></h4>
                        <%=msg%>

                    </div>
                    <%session.removeAttribute("status");
                            session.removeAttribute("msg");
                        }%>
                    <div class="row-fluid">
                        <div class="span12">
                            <div class="box">
                                <div class="box-head">
                                    <h3>Income Expense</h3>
                                    <a href="IncomeExpense.jsp">
                                        <button style="float: right" class="btn btn-success">View Income Expense</button>
                                    </a>
                                </div>
                                <form action="/RIT/AddIncomeExpense" method="post" class='validate form-horizontal'>
                                    <div class="box-content">
                                        <!---Form Start....-->
                                        <table >
                                            <%{

                                                    Calendar mycal = new GregorianCalendar(2014, Calendar.MAY, 1);

                                                    int daysInMonth = mycal.getActualMaximum(Calendar.DAY_OF_MONTH);
                                                    int weekends = mycal.getActualMaximum(Calendar.SUNDAY);
                                                    int count = 0;
                                                    out.println("<tr>");
                                                    out.println("<td class='headings'></td>");

                                                    for (int day = 1; day <= daysInMonth; day++) {
                                                        int date = 0;
                                                        mycal.set(2014, Calendar.MAY, day);
                                                        int dayOfWeek = mycal.get(Calendar.DAY_OF_WEEK);
                                                        date = mycal.get(Calendar.DATE);
                                                        out.println("<td>");
                                                        if (dayOfWeek == Calendar.SUNDAY) {
                                                            out.println("<span style='color:red;'>S</span>");
                                                        } else {
                                                            out.println(date);
                                                        }
                                                        out.println("</td>");
                                                    }
                                                    out.println("</tr>");
                                                }%>
                                            <br>
                                            <%{
                                                    Calendar cal = Calendar.getInstance();
                                                    int dNow = cal.get(Calendar.DATE);
                                                    out.println(dNow);
                                                    
                                                    Calendar mycal = new GregorianCalendar(2014, Calendar.MAY, 1);

                                                    int daysInMonth = mycal.getActualMaximum(Calendar.DAY_OF_MONTH);
                                                    int weekends = mycal.getActualMaximum(Calendar.SUNDAY);

                                                    int count = 0;
                                                    out.println("<tr>");
                                                    out.println("<td>Name</td>");
                                                    for (int day = 1; day <= daysInMonth; day++) {
                                                        int date = 0;
                                                        mycal.set(2014, Calendar.MAY, day);
                                                        int dayOfWeek = mycal.get(Calendar.DAY_OF_WEEK);
                                                        date = mycal.get(Calendar.DATE);
                                                        out.println("<td>");
                                                        if (dayOfWeek == Calendar.SUNDAY) {
                                                            //out.println("<span style='color:red;'>S</span>");
                                                        } else {
                                                            out.println("<input type='checkbox' disable>");
                                                        }
                                                        out.println("</td>");
                                                    }
                                                    out.println("</tr>");

                                                }
                                            %>
                                        </table>
                                        <div id="feeDetail">
                                        </div>
                                        <!---Form Ends....-->
                                    </div>
                                    <div class="form-actions">
                                        <input type="submit" class='btn btn-primary'  id="subfm">
                                    </div>
                                </form>                                        </div>
                        </div>
                    </div>
                </div>	
            </div>
        </div>
        <script src="/RIT/js/jquery.js"></script>
        <script src="/RIT/js/less.js"></script>
        <script src="/RIT/js/bootstrap.min.js"></script>
        <script src="/RIT/js/jquery.uniform.min.js"></script>
        <script src="/RIT/js/bootstrap.timepicker.js"></script>
        <script src="/RIT/js/bootstrap.datepicker.js"></script>
        <script src="/RIT/js/chosen.jquery.min.js"></script>
        <script src="/RIT/js/jquery.fancybox.js"></script>
        <script src="/RIT/js/plupload/plupload.full.js"></script>
        <script src="/RIT/js/plupload/jquery.plupload.queue/jquery.plupload.queue.js"></script>
        <script src="/RIT/js/jquery.cleditor.min.js"></script>
        <script src="/RIT/js/jquery.inputmask.min.js"></script>
        <script src="/RIT/js/jquery.tagsinput.min.js"></script>
        <script src="/RIT/js/jquery.mousewheel.js"></script>
        <script src="/RIT/js/jquery.textareaCounter.plugin.js"></script>
        <script src="/RIT/js/ui.spinner.js"></script>
        <script src="/RIT/js/jquery.jgrowl_minimized.js"></script>
        <script src="/RIT/js/jquery.form.js"></script>
        <script src="/RIT/js/jquery.validate.min.js"></script>
        <script src="/RIT/js/bbq.js"></script>
        <script src="/RIT/js/jquery-ui-1.8.22.custom.min.js"></script>
        <script src="/RIT/js/jquery.form.wizard-min.js"></script>
        <script src="/RIT/js/jquery.cookie.js"></script>
        <script src="/RIT/js/jquery.metadata.js"></script>
        <script src="/RIT/js/custom.js"></script><script src="/RIT/js/demo.js"></script>
        <script src="/RIT/js/iconfont.js"></script>
    </body>
</html>

<%} else {
%>
<script type="text/javascript">
    alert("You Are Not Authorised");
    window.history.back();
</script>
<%             }
        } else {
            request.setAttribute("msg", "You Are Not Authorised! Please Contact to System Administrator!");
            request.setAttribute("value", "0");
            getServletContext().getRequestDispatcher("/index.jsp").forward(request, response);
        }
    } catch (Exception e) {
        request.setAttribute("msg", "Please Contact to System Administrator!");
        request.setAttribute("value", "0");
        getServletContext().getRequestDispatcher("/index.jsp").forward(request, response);
    }
%>

